FROM centos:latest
ADD ./justinchou/docker-hexo /opt/software/

RUN rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
RUN yum -y install gcc automake autoconf libtool make gcc+ gcc-c++

RUN cd /opt/software/ && tar zxvf node-v0.12.7.tar.gz
RUN cd /opt/software/node-v0.12.7 && ./configure && make && make install

RUN cd /opt/software/ && tar zxvf redis-3.0.2.tar.gz
RUN cd /opt/software/redis-3.0.2 && make && make install

RUN npm install -g hexo
RUN mkdir -p /opt/projects
RUN cd /opt/projects && hexo init nodejs-hexo
RUN cd /opt/projects/nodejs-hexo && npm install

